﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace TestVisioCanvas.Models
{
    /// <summary>
    /// Base Notify Model that implements the INotifyPropertyChanged for the DataBinding mechanism
    /// </summary>
    public class BaseNotify : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// Method to call on every update or modify on a Binded or possibly Binded property.
        /// </summary>
        /// <param name="propertyName">The name of the property that is changed</param>
        public void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
